import React, { Component } from 'react';

class MainBox extends Component {
  render () {
    const unReadMessage = this.props.unReadMessage
    return (
      <div>
        您好，还还有{ unReadMessage.length > 0 && <div>{ unReadMessage.length }</div> }封未读邮件
      </div>
    )
  }
}
// 假如有初始化的数据 proList:[],请求数据以后，得到列表数据 ， proList && proList.map() 遍历数据

const messages = ['1', '2', '3', '4']
class App extends Component {
 
  render() {
    return (
      <div>
        <MainBox unReadMessage = { messages } />
      </div>
    );
  }
}

export default App;